home *** CD-ROM | disk | FTP | other *** search
- /*
- NIServer.h
- NetInfo Server Class
- Copyright (c) 1994, NeXT Computer, Inc.
- All rights reserved.
- */
-
- #ifndef STRICT_OPENSTEP
-
- #import <Foundation/NSString.h>
- #import <Foundation/NSDictionary.h>
- #import <Foundation/NSDate.h>
- @class NSHost;
-
- @interface NIServer : NSObject
- {
- @private
- NSString *serverName;
- NSHost *host;
- NSString *tag;
- void *connection;
- int timeout;
- int abort;
- BOOL isMaster;
- BOOL _didSetIsMaster;
- id reserved;
- }
-
- /*
- * Get a server object. Server are cached by default (see below).
- */
- + (NIServer *)serverWithHost:(NSHost *)aHost tag:(NSString *)aTag;
- + (NIServer *)serverWithHost:(NSHost *)aHost
- tag:(NSString *)aTag
- readTimeout:(NSTimeInterval)rtime
- writeTimeout:(NSTimeInterval)wtime;
-
- /*
- * Server cache management
- * If enabled, only one object representing each server is created, and
- * a shared instance is returned by all methods that return a server.
- */
- + (BOOL)isServerCacheEnabled;
- + (void)setServerCacheEnabled:(BOOL)flag;
- + (void)flushServerCache;
-
- /*
- * name, host and tag.
- * names are strings of the form: @"hostname/tag"
- */
- - (NSString *)name;
- - (NSHost *)host;
- - (NSString *)serverTag;
-
- /*
- * Server information.
- */
- - (BOOL)isMaster;
- - (BOOL)isClone;
- - (NSDictionary *)statistics;
- - (NIServer *)parentServer;
-
- /*
- * Force a synchronization. If connected to the master this
- * syncs the whole domain. If connected to a clone, then force
- * the clone to synchronize with the master.
- */
- - (void)synchronize;
-
- /*
- * Check server
- */
- - (BOOL)isAlive;
-
- /*
- * Get netinfo(3) library handle.
- * Use of the handle should be avoided if at all possible.
- * If the handle is used to make netinfo(3) library calls, and the
- * application is multi-threaded, then the call should be protected using
- * NINetInfo "lock" and "unlock". For example:
- *
- * ni_status status;
- * NINetInfo *ni = [NINetInfo netinfo];
- * void *handle = [aServer handle];
- * [ni lock];
- * status = ni_read(handle, ...);
- * [ni unlock];
- *
- */
- - (void *)handle;
-
- @end
-
- #endif STRICT_OPENSTEP
-